fix(ssh): run SSHConnectionParams auth validator on pydantic >=2.12#1346
Open
jayantkamble10000 wants to merge 1 commit into
Open
fix(ssh): run SSHConnectionParams auth validator on pydantic >=2.12#1346jayantkamble10000 wants to merge 1 commit into
jayantkamble10000 wants to merge 1 commit into
Conversation
🟡 Heimdall Review Status
|
check_auth_method_provided used @classmethod together with @model_validator(mode=after). That combination is deprecated and silently skipped on pydantic >= 2.12, so the auth-method/host/username checks never ran. Make it an instance-method mode=after validator, supported across pydantic 2.x and 3.0.
8cb0cf1 to
67d06dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
SSHConnectionParams.check_auth_method_providedis decorated with both@classmethodand@model_validator(mode="after"). On pydantic >= 2.12 that combination is deprecated and the validator is silently skipped (pydantic emitsPydanticDeprecatedSince212and does not run it), soSSHConnectionParamscan be constructed with no authentication method, empty host, or empty username.Why
The committed
uv.lockpins pydantic 2.10.4 (where it still runs), butpyproject.tomlallowspydantic~=2.0(i.e. >= 2.12), and pydantic 3.0 removes the pattern entirely — so on those installs the intended validation is lost.Change
python/coinbase-agentkit/coinbase_agentkit/action_providers/ssh/connection.py— makecheck_auth_method_providedan instance-methodmode="after"validator (drop@classmethod, useself,return self), the supported pattern across pydantic 2.x and 3.0.